package rs.dalao.syc.index.dao.persist.repository.impl;/*
 *   @author:Casin
 *   @date:2023/8/4
 *   @code:
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import rs.dalao.syc.index.dao.persist.mapper.EncyclopediaMapper;
import rs.dalao.syc.index.dao.persist.repository.IEncRepository;
import rs.dalao.syc.index.pojo.vo.*;

import java.util.List;

@Repository
public class EncRepositoryImpl implements IEncRepository {
    @Autowired
    EncyclopediaMapper mapper;

    @Override
    public List<DepartmentVO> selectDep() {
        return mapper.selectDep();
    }

    @Override
    public List<EncContentListVO> getEncContentList(Long depId) {
        return mapper.selectListByArticleId(depId);
    }

    @Override
    public List<EncOtherDocVO> getOtherDocByDep(Long depId) {
        return mapper.getOtherDocByDep(depId);
    }

    @Override
    public List<EncDetailVO> selectByIdForDetail(Long articleId) {
        return mapper.selectByIdForDetail(articleId);
    }

    @Override
    public List<HotDetailVO> selectEncHotDetail(Long depId){
        return mapper.selectEncHotDetail(depId);
    }

    //查询到所有的文章相关信息存入Elasticsearch数据库
    @Override
    public List<EncContentSearchVO> selectAll() {
        return mapper.selectAll();
    }
}
